package com.twotwoshop.service.goods.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.twotwoshop.commom.redis.RedisConstants;
import com.twotwoshop.domin.common.dtos.ResponseResult;
import com.twotwoshop.domin.goods.pojo.ProductFavorite;
import org.springframework.scheduling.annotation.Async;

public interface ProductFavoriteService extends IService<ProductFavorite> {


    /**
     * 收藏
     * @param productFavorite
     * @return
     */
    ResponseResult addFavorite(ProductFavorite productFavorite);

    /**
     * 检查收藏状态
     * @param id
     * @return
     */
    ResponseResult checkFavorite(Long id);

    /**
     *
     * 取消收藏
     * @param productFavorite
     * @return
     */
    ResponseResult cancelFavorite(ProductFavorite productFavorite);


    /**
     * 异步更新商品的收藏量
     *
     * @param
     * @return
     */
    public void upFavourite(Long id,Long userId);


    /**
     * 异步删除商品收藏
     *
     * @param productId
     * @param userId
     */
    public void deleteFavourite(Long productId,Long userId);


    /**
     *
     * 查询收藏商品
     *
     * @return
     */
    ResponseResult selectFavorite();
}